﻿/*
 * Created by SharpDevelop.
 * User: Administrator
 * Date: 08/08/2017
 * Time: 09:44
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Windows.Data;
using System.Windows;

namespace ProxyEditor
{
	/// <summary>
	/// Description of Class1.
	/// </summary>
	public class EnableConvert:IValueConverter
	{
		#region IValueConverter implementation
		public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			//throw new NotImplementedException();
			if (value == null)
                return DependencyProperty.UnsetValue;
			
			Boolean bEnabled=(Boolean)value;
			
			if(bEnabled){
				return @"禁用代理";
			}
			else{
				return @"启用代理";
			}
		}
		public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			//throw new NotImplementedException();
			
			String s=value.ToString();
			
			if(s==@"禁用代理")
				return false;
			else
				return true;
		}
		#endregion
		// disable once EmptyConstructor
		
	}
}
